package com.sky.mapper;

import com.sky.entity.Employee;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface EmployeeMapper {

    /**
     * 根据用户名查询员工
     * @param username
     * @return
     */
    @Select("select * from employee where username = #{username}")
    Employee getByUsername(String username);

    /** 
     * @description: 新增员工
     * @param: employee 员工信息
     * @return: void 
     * @author STJ12138
     * @date: 2023/5/10 8:41
     */
    void insert(Employee employee);

    /**
     * @description: 根据员工姓名查询员工
     * @param: name 员工姓名
     * @return: java.util.List<com.sky.entity.Employee>
     * @author STJ12138
     * @date: 2023/5/10 8:42
     */
    List<Employee> findAll(String name);

    /**
     * @description: 修改员工
     * @param: employee
     * @return: void
     * @author STJ12138
     * @date: 2023/5/10 20:05
     */
    void update(Employee employee);

    /**
     * @description: 根据id查询员工
     * @param: id 员工id
     * @return: com.sky.result.Result<com.sky.entity.Employee>
     * @author STJ12138
     * @date: 2023/5/10 21:09
     */
    Employee findById(Long id);
}
